/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-10-19
 * Time: 22:54
 */
public class Test {
    public static boolean checkWon(int[][] board) {
        // write code here

        for(int i=0;i<3;i++){
            if(board[i][0] + board[i][1] + board[i][2] == 3 )
                return true;
        }

        for(int i=0;i<3;i++){
            if(board[0][i] + board[1][i] + board[2][i] == 3)
                return true;
        }

        if(board[0][0] + board[1][1] + board[2][2] == 3)
            return true;

        return board[0][2] + board[1][1] + board[2][0] == 3;
    }

    public static void main(String[] args) {
        int[][] board = new int[3][3];
        // [[1,0,1],[1,-1,-1],[1,-1,0]]
        board[0][0] = 1;
        board[0][1] = 0;
        board[0][2] = 1;

        board[1][0] = 1;
        board[1][1] = -1;
        board[1][2] = -1;

        board[2][0] = 1;
        board[2][1] = -1;
        board[2][2] = 0;

        System.out.println(checkWon(board)); // true;
    }
}
